Use GSlice to allocate the application data for recently used resources;
authorEmmanuele Bassi <ebassi@gnome.org>
Mon, 21 Jul 2008 13:37:15 +0000 (13:37 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Mon, 21 Jul 2008 13:37:15 +0000 (13:37 +0000)
2008-07-21  Emmanuele Bassi  <ebassi@gnome.org>

* gtk/gtkrecentmanager.c:
(recent_app_info_new), (recent_app_info_free): Use GSlice to
allocate the application data for recently used resources;
do not call time() to initialize the timestamp, as it will
be overwritten anyway later. (#535223, Michael Meeks)

svn path=/trunk/; revision=20884

ChangeLog
gtk/gtkrecentmanager.c

index db85c884cc592665dfa34544df1952e40ac7e80e..6920491e75dbc7ac55c7002fcbc5357f5a2bd2b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-07-21  Emmanuele Bassi  <ebassi@gnome.org>
+
+       * gtk/gtkrecentmanager.c:
+       (recent_app_info_new), (recent_app_info_free): Use GSlice to
+       allocate the application data for recently used resources;
+       do not call time() to initialize the timestamp, as it will
+       be overwritten anyway later. (#535223, Michael Meeks)
+
 2008-07-21  Kristian Rietveld  <kris@gtk.org>
 
        Bug 543989 - Crash in gtk_tree_view_size_allocate_columns
index fea41ad65837dc60c6218e1dd59f118336502684..c7ee3b3280bf18d3eabfd02f692bb4e520c3306c 100644 (file)
@@ -1690,11 +1690,11 @@ recent_app_info_new (const gchar *app_name)
 
   g_assert (app_name != NULL);
   
-  app_info = g_new0 (RecentAppInfo, 1);
+  app_info = g_slice_new0 (RecentAppInfo);
   app_info->name = g_strdup (app_name);
   app_info->exec = NULL;
   app_info->count = 1;
-  app_info->stamp = time (NULL);
+  app_info->stamp = 0; 
   
   return app_info;
 }
@@ -1706,10 +1706,9 @@ recent_app_info_free (RecentAppInfo *app_info)
     return;
   
   g_free (app_info->name);
-  
   g_free (app_info->exec);
   
-  g_free (app_info);
+  g_slice_free (RecentAppInfo, app_info);
 }
 
 /**